package com.kedacom.demo.modularity.ams;

import java.util.Date;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "user")
public class User {

	private Integer id;
	private String moid;
	private String name; // 用户姓名
	private String email;
	private String username; // 用户登录帐号
	private String password;
	private Date birthday;

	private UserProfile profile;

	public User() {
	}

	public User(Integer id, String moid, String name, String email, String username, String password) {
		this.id = id;
		this.moid = moid;
		this.name = name;
		this.email = email;
		this.username = username;
		this.password = password;
	}

	public User(Integer id, String moid, String name, String email, String username, String password, String address,
			String phone) {
		this(id, moid, name, email, username, password);
		this.profile = new UserProfile();
		this.profile.setAddress(address);
		this.profile.setPhone(phone);
	}

	public User(Integer id, String moid, String name, String email, String username, String password, Date birthday) {
		this(id, moid, name, email, username, password);
		this.birthday = birthday;
	}

	public String toString() {
		return String.format("{id=%d,moid=%s,name=%s,email=%s,username=%s}", id, moid, name, email, username);
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getMoid() {
		return moid;
	}

	public void setMoid(String moid) {
		this.moid = moid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserProfile getProfile() {
		return profile;
	}

	public void setProfile(UserProfile profile) {
		this.profile = profile;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

}
